/*     */ package com.zimbra.cs.index;
/*     */ 
/*     */ import com.google.common.collect.ImmutableMap;
/*     */ import com.google.common.collect.ImmutableMap.Builder;
/*     */ import com.zimbra.cs.mailbox.Flag;
/*     */ import java.util.Map;
/*     */ import org.apache.lucene.document.Field.Index;
/*     */ import org.apache.lucene.document.Field.Store;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public final class LuceneFields
/*     */ {
/*  40 */   public static final Map<String, Character> FIELD2PREFIX = ImmutableMap.builder().put("l.content", Character.valueOf('A')).put("l.contactData", Character.valueOf('B')).put("type", Character.valueOf('C')).put("attachment", Character.valueOf('D')).put("filename", Character.valueOf('E')).put("has", Character.valueOf('F')).put("from", Character.valueOf('G')).put("to", Character.valueOf('H')).put("cc", Character.valueOf('I')).put("env_from", Character.valueOf('J')).put("env_to", Character.valueOf('K')).put("msg_id", Character.valueOf('L')).put("subject", Character.valueOf('M')).put("l.field", Character.valueOf('N')).put("l.date", Character.valueOf('O')).put("l.partname", Character.valueOf('P')).put("l.mbox_blob_id", Character.valueOf('Q')).put("hasAttach", Character.valueOf('R')).put("hasFlag", Character.valueOf('S')).put("priority", Character.valueOf('T')).put("l.size", Character.valueOf('U')).build();
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static final String ITEM_ID_PREFIX = "x";
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static final String L_SORT_SUBJECT = "subjSort";
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static final String L_SORT_NAME = "nameSort";
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static final String L_SORT_DATE = "l.date";
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static final String L_SORT_SIZE = "l.size";
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static final String L_SORT_ATTACH = "hasAttach";
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static final String L_SORT_FLAG = "hasFlag";
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static final String L_SORT_PRIORITY = "priority";
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static final String L_MAILBOX_BLOB_ID = "l.mbox_blob_id";
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static final String L_ATTACHMENTS = "attachment";
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static final String L_ATTACHMENT_NONE = "none";
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static final String L_ATTACHMENT_ANY = "any";
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static final String L_CONTENT = "l.content";
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static final String L_OBJECTS = "has";
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static final String L_MIMETYPE = "type";
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static final String L_VERSION = "l.version";
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static final String L_CONTACT_DATA = "l.contactData";
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static final String L_PARTNAME = "l.partname";
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static final String L_PARTNAME_CONTACT = "CONTACT";
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static final String L_PARTNAME_NOTE = "NOTE";
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static final String L_PARTNAME_NONE = "none";
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static final String L_PARTNAME_TOP = "top";
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static final String L_FILENAME = "filename";
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static final String L_H_FROM = "from";
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static final String L_H_TO = "to";
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static final String L_H_CC = "cc";
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static final String L_H_SUBJECT = "subject";
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static final String L_H_X_ENV_FROM = "env_from";
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static final String L_H_X_ENV_TO = "env_to";
/*     */   
/*     */ 
/*     */ 
/*     */   public static final String L_H_MESSAGE_ID = "msg_id";
/*     */   
/*     */ 
/*     */ 
/*     */   public static final String L_FIELD = "l.field";
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static enum IndexField
/*     */   {
/* 200 */     MIMETYPE("type", Field.Store.YES, Field.Index.ANALYZED), 
/* 201 */     PARTNAME("l.partname", Field.Store.YES, Field.Index.NOT_ANALYZED), 
/* 202 */     FILENAME("filename", Field.Store.YES, Field.Index.ANALYZED), 
/* 203 */     SORT_SIZE("l.size", Field.Store.YES, Field.Index.NOT_ANALYZED), 
/* 204 */     SORT_ATTACH("hasAttach", Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS), 
/* 205 */     SORT_FLAG("hasFlag", Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS), 
/* 206 */     SORT_PRIORITY("priority", Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS), 
/* 207 */     H_FROM("from", Field.Store.YES, Field.Index.ANALYZED), 
/* 208 */     H_TO("to", Field.Store.YES, Field.Index.ANALYZED), 
/* 209 */     H_CC("cc", Field.Store.YES, Field.Index.ANALYZED), 
/* 210 */     H_X_ENV_FROM("env_from", Field.Store.YES, Field.Index.ANALYZED), 
/* 211 */     H_X_ENV_TO("env_to", Field.Store.YES, Field.Index.ANALYZED), 
/* 212 */     H_MESSAGE_ID("msg_id", Field.Store.NO, Field.Index.NOT_ANALYZED), 
/* 213 */     FIELD("l.field", Field.Store.YES, Field.Index.ANALYZED), 
/* 214 */     SORT_NAME("nameSort", Field.Store.NO, Field.Index.NOT_ANALYZED), 
/* 215 */     H_SUBJECT("subject", Field.Store.NO, Field.Index.ANALYZED), 
/* 216 */     SORT_SUBJECT("subjSort", Field.Store.NO, Field.Index.NOT_ANALYZED), 
/* 217 */     CONTENT("l.content", Field.Store.NO, Field.Index.ANALYZED), 
/* 218 */     ATTACHMENTS("attachment", Field.Store.YES, Field.Index.ANALYZED), 
/* 219 */     MAILBOX_BLOB_ID("l.mbox_blob_id", Field.Store.YES, Field.Index.NOT_ANALYZED), 
/* 220 */     SORT_DATE("l.date", Field.Store.YES, Field.Index.NOT_ANALYZED), 
/* 221 */     CONTACT_DATA("l.contactData", Field.Store.NO, Field.Index.ANALYZED), 
/* 222 */     OBJECTS("has", Field.Store.NO, Field.Index.ANALYZED), 
/* 223 */     VERSION("l.version", Field.Store.YES, Field.Index.NOT_ANALYZED);
/*     */     
/*     */     private String fieldName;
/*     */     private Field.Store storeSetting;
/*     */     private Field.Index indexSetting;
/*     */     
/* 229 */     private IndexField(String fieldName, Field.Store storeSetting, Field.Index indexSetting) { this.fieldName = fieldName;
/* 230 */       this.storeSetting = storeSetting;
/* 231 */       this.indexSetting = indexSetting;
/*     */     }
/*     */     
/* 234 */     public String getFieldName() { return this.fieldName; }
/*     */     
/*     */     public Field.Store getStoreSetting() {
/* 237 */       return this.storeSetting;
/*     */     }
/*     */     
/* 240 */     public Field.Index getIndexSetting() { return this.indexSetting; }
/*     */     
/*     */     public static IndexField fromFieldName(String name) {
/* 243 */       for (IndexField ifield : ) {
/* 244 */         if (ifield.getFieldName().equals(name)) {
/* 245 */           return ifield;
/*     */         }
/*     */       }
/* 248 */       throw new IllegalArgumentException("Unrecognised Index field name " + name);
/*     */     }
/*     */   }
/*     */   
/*     */   public static String valueForBooleanField(boolean value) {
/* 253 */     return value ? "1" : "0";
/*     */   }
/*     */   
/*     */   public static String valueForPriority(int flags) {
/* 257 */     if ((flags & Flag.BITMASK_HIGH_PRIORITY) != 0)
/* 258 */       return "2";
/* 259 */     if ((flags & Flag.BITMASK_LOW_PRIORITY) != 0) {
/* 260 */       return "0";
/*     */     }
/* 262 */     return "1";
/*     */   }
/*     */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/index/LuceneFields.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */